package com.ruoyi.system.service.impl;

import java.time.LocalDateTime;
import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TMessageRecordMapper;
import com.ruoyi.system.domain.TMessageRecord;
import com.ruoyi.system.service.ITMessageRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 消息记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-16
 */
@Service
public class TMessageRecordServiceImpl extends ServiceImpl<TMessageRecordMapper, TMessageRecord> implements ITMessageRecordService {
    @Autowired
    private TMessageRecordMapper tMessageRecordMapper;


    /**
     * 查询消息记录
     *
     * @param id 消息记录主键
     * @return 消息记录
     */
    @Override
    public TMessageRecord selectTMessageRecordById(Long id) {
        return tMessageRecordMapper.selectTMessageRecordById(id);
    }

    /**
     * 查询消息记录列表
     *
     * @param tMessageRecord 消息记录
     * @return 消息记录
     */
    @Override
    public List<TMessageRecord> selectTMessageRecordList(TMessageRecord tMessageRecord) {
        return tMessageRecordMapper.selectTMessageRecordList(tMessageRecord);
    }

    /**
     * 新增消息记录
     *
     * @param tMessageRecord 消息记录
     * @return 结果
     */
    @Override
    public int insertTMessageRecord(TMessageRecord tMessageRecord) {
                tMessageRecord.setCreateTime(LocalDateTime.now());
            return tMessageRecordMapper.insertTMessageRecord(tMessageRecord);
    }

    /**
     * 修改消息记录
     *
     * @param tMessageRecord 消息记录
     * @return 结果
     */
    @Override
    public int updateTMessageRecord(TMessageRecord tMessageRecord) {
        return tMessageRecordMapper.updateTMessageRecord(tMessageRecord);
    }

    /**
     * 批量删除消息记录
     *
     * @param ids 需要删除的消息记录主键
     * @return 结果
     */
    @Override
    public int deleteTMessageRecordByIds(Long[] ids) {
        return tMessageRecordMapper.deleteTMessageRecordByIds(ids);
    }

    /**
     * 删除消息记录信息
     *
     * @param id 消息记录主键
     * @return 结果
     */
    @Override
    public int deleteTMessageRecordById(Long id) {
        return tMessageRecordMapper.deleteTMessageRecordById(id);
    }
}
